body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100vh;
  overflow: hidden;
}

/* 全局加载和错误状态 */
.app-loading,
.app-error {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  background: rgba(255, 255, 255, 0.95);
  z-index: 2000;
}

.loading-content,
.error-content {
  padding: 24px 48px;
  border-radius: 8px;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.loading-content {
  background-color: #fff;
  color: #1890ff;
  display: flex;
  align-items: center;
  gap: 12px;
}

.loading-content::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #1890ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.error-content {
  background-color: #fff2f0;
  color: #f5222d;
  border: 1px solid #ffccc7;
  max-width: 80%;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  background-color: #fff;
  box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.header-title {
  font-size: 18px;
  font-weight: 600;
  color: #1890ff;
  width: 200px;
}

.header-tabs {
  display: flex;
  flex: 1;
  justify-content: center;
  height: 100%;
}

.tab-item {
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: rgba(0, 0, 0, 0.65);
  transition: all 0.3s;
}

.tab-item:hover {
  color: #1890ff;
}

.tab-item.active {
  color: #1890ff;
  border-bottom: 2px solid #1890ff;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex: 1;
  max-width: 500px;
}

.new-knowledge-btn {
  padding: 4px 12px;
  height: 32px;
  background-color: #1890ff;
  color: #fff;
  border: 1px solid #1890ff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: all 0.3s;
}

.new-knowledge-btn:hover {
  background-color: #40a9ff;
  border-color: #40a9ff;
}

.new-knowledge-btn:active {
  background-color: #096dd9;
  border-color: #096dd9;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 300px;
}

.search-box input {
  padding: 4px 11px 4px 30px;
  height: 32px;
  font-size: 14px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  outline: none;
  transition: all 0.3s;
}

.search-box input:focus {
  border-color: #40a9ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.search-icon {
  position: absolute;
  left: 8px;
  color: rgba(0, 0, 0, 0.25);
}

.avatar {
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #f0f2f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

/* Secondary Menu */
.secondary-menu {
  background-color: #fff;
  box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
  position: fixed;
  top: 64px;
  left: 0;
  bottom: 0;
  width: 200px;
  overflow-y: auto;
  border-right: 1px solid #f0f0f0;
}

.secondary-menu-content {
  padding: 16px 0;
}

.secondary-tab-item {
  padding: 12px 24px;
  cursor: pointer;
  transition: all 0.3s;
  color: rgba(0, 0, 0, 0.65);
}

.secondary-tab-item:hover {
  background-color: #f5f5f5;
  color: #1890ff;
}

.secondary-tab-item.active {
  background-color: #e6f7ff;
  color: #1890ff;
  border-right: 3px solid #1890ff;
}

/* Main Content */
.app-content {
  margin-top: 64px;
  margin-left: 200px;
  padding: 24px;
  min-height: calc(100vh - 112px);
  background-color: #f5f5f5;
}

.content-area {
  background: #fff;
  padding: 24px;
  border-radius: 4px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  min-height: calc(100vh - 160px);
}

.content-area h2 {
  margin-top: 0;
  color: rgba(0, 0, 0, 0.85);
  font-weight: 500;
  font-size: 20px;
  margin-bottom: 16px;
}

.content-area p {
  margin: 0;
  color: rgba(0, 0, 0, 0.65);
  line-height: 1.6;
}

/* Question List Styles */
.question-list {
  margin-top: 24px;
}

.question-item {
  background: #fff;
  border-radius: 4px;
  padding: 16px 24px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  transition: all 0.3s;
  border-left: 3px solid transparent;
}

.question-item:hover {
  box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.08);
  border-left-color: #1890ff;
  transform: translateX(2px);
}

.question-title {
  font-size: 16px;
  color: rgba(0, 0, 0, 0.85);
  margin: 0 0 12px 0;
  font-weight: 500;
}

.question-meta {
  display: flex;
  margin-bottom: 12px;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.45);
}

.meta-item {
  display: flex;
  align-items: center;
  margin-right: 24px;
}

.meta-label {
  color: rgba(0, 0, 0, 0.45);
  margin-right: 4px;
}

.meta-value {
  color: rgba(0, 0, 0, 0.65);
  font-weight: 500;
}

.question-summary {
  font-size: 14px;
  color: rgba(0, 0, 0, 0.65);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
